import {createApp} from 'vue'
import './styles/index.scss'
import App from './App.vue'
import AppLoading from './components/app-loading/index.vue'
import setupPinia from "./stores";
import setupRouter from "./router";
import 'virtual:uno.css'
import VueJsonPretty from 'vue-json-pretty'
import 'vue-json-pretty/lib/styles.css';
import setupPermissionCommand from "@/command/permission.ts";

const setupApp = async () => {
    const app = createApp(App);
    await setupPinia(app)
    setupPermissionCommand(app)
    const appLoading = createApp(AppLoading);
    appLoading.mount('#app-loading');
    await setupRouter(app);
    appLoading.unmount();
    app.component("vue-json-pretty", VueJsonPretty)
    app.mount('#app');
}

setupApp()
